<!--
 * @description: 入口
 * @Author: Islands
 * @Date: 2023-05-31 10:52:20
 * @LastEditTime: 2024-03-28 15:00:10
-->
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { storeToRefs } from "pinia";
import { useLocalStore } from "@/store/index";
import Layout01 from "./layout/layout01/index.vue";
import Layout02 from "./layout/layout02/index.vue";
const { animation, language, layout } = storeToRefs(useLocalStore());
const component = (_path: any, _Component: any, _route: any) => {
  if (_path == "/login") {
    return _Component;
  } else {
    if (layout.value == 0) {
      return Layout01;
    } else {
      return _Component;
    }
  }
};
</script>
<template>
  <el-config-provider :locale="language.value">
    <router-view #default="{ route, Component }">
      <transition
        :enter-active-class="`animate__animated ` + animation.value"
        appear
      >
        <keep-alive>
          <component :is="component(route.fullPath, Component, route)" />
        </keep-alive>
      </transition>
    </router-view>
  </el-config-provider>
</template>
<style scoped></style>
